package com.yuan.algorithms.practice201505;

import java.util.Scanner;

public class 大数a加b {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext())
		{
			int T=sc.nextInt();
				for(int o=1;o<=T;o++)
				{
					String a=sc.next();
					String b=sc.next();
					if(o!=1)
						System.out.println();
					System.out.println("Case "+o+":");
					System.out.print(a+" + "+b);
					System.out.print(" = ");
					Sum(a, b);
				}
			}
	}
	//加法运算
    public static void Sum(String a, String b) {
        int alength = a.length();
        int blength = b.length();
        int length = alength > blength ? alength + 1 : blength + 1;
        int[] arrA = new int[length];
        int[] arrB = new int[length];
        int[] sum = new int[length];
        for (int i = alength - 1, j = length - 1; i >= 0; i--, j--) {
            arrA[j] = a.charAt(i) - '0';
        }
        for (int i = blength - 1, j = length - 1; i >= 0; i--, j--) {
            arrB[j] = b.charAt(i) - '0';
        }
        for (int i = length - 1; i >= 0; i--) {
            sum[i] = arrA[i] + arrB[i];
        }
        for (int i = length - 1; i >= 0; i--) {
            if (sum[i] > 9) {
                sum[i] = sum[i] % 10;
                sum[i - 1]++;
            }
        }
        for (int i = 0, k = 0; i < sum.length; i++) {
            if (sum[i] == 0 && k == 0) {
                continue;
            } else {
                System.out.print(sum[i]);
                k = 1;
            }
        }
        System.out.println();
    }
}

